package com.dldata.devtools30.utils.dataexport;

import com.dldata.devtools30.utils.StringUtil;

import java.util.LinkedList;
import java.util.List;

public class TableConfig {
    /**
     * 表名
     */
    private String tablename="";
    /**
     * 中文表名
     */
    private String tablenameZh="";

    /**
     *查询条件的字段表名
     */
    private String fieldname="";
    /**
     * 父表的数据关联字段 (与前面的查询条件字段名关联)
     */
    private String ffieldname="";


    //是否生成del语句
    private String sqldel="";

    public TableConfig(){

    }

    public TableConfig(String tablename,String tablenameZh,String fieldname,String ffieldname,Boolean sqldel){
        this.tablename=tablename;
        this.tablenameZh=tablenameZh;
        this.ffieldname=ffieldname;
        this.fieldname=fieldname;
        this.sqldel= StringUtil.isEmptyOrLength0(sqldel)?Boolean.FALSE.toString().toLowerCase():sqldel.toString().toLowerCase();
    }

    public TableConfig(String tablename,String tablenameZh,String fieldname,String ffieldname){
        this.tablename=tablename;
        this.tablenameZh=tablenameZh;
        this.ffieldname=ffieldname;
        this.fieldname=fieldname;
    }

    private List<TableConfig> subtableList=new LinkedList<>();

    public String getTablename() {
        return tablename;
    }

    public void setTablename(String tablename) {
        this.tablename = tablename;
    }

    public String getTablenameZh() {
        return tablenameZh;
    }

    public void setTablenameZh(String tablenameZh) {
        this.tablenameZh = tablenameZh;
    }

    public String getFieldname() {
        return fieldname;
    }

    public void setFieldname(String fieldname) {
        this.fieldname = fieldname;
    }

    public String getFfieldname() {
        return ffieldname;
    }

    public void setFfieldname(String ffieldname) {
        this.ffieldname = ffieldname;
    }

    public List<TableConfig> getSubtableList() {
        return subtableList;
    }
    public void setSubtableList(List<TableConfig> subtableList) {
        this.subtableList = subtableList;
    }

    public String getSqldel() {
        return sqldel;
    }

    public void setSqldel(String sqldel) {
        this.sqldel = sqldel;
    }

}
